package learnjdk.parallel;

import java.util.List;

/**
 * 准备测试并行流在顺序情况下没有串行好
 *
 * Created by alex on 2017/7/15.
 */
public class OrderParallelTest {

    public static void main(String[] args) {
        List<Integer> list = Main.buildTestList(10000, 15);
        long t0 = System.currentTimeMillis();
        Main.looper(OrderParallelTest::pfun, list, 10000);
        System.out.println("cost:" + (System.currentTimeMillis() - t0));
    }

    private static void pfun(List<Integer> list) {
        list.parallelStream().findFirst().get();
    }

    private static void sfun(List<Integer> list) {
        list.stream().findFirst().get();
    }

}
